<template>
  <div class="logic-home">
    <div class="list-header">我的笔记</div>
    <div v-for="item in list" :key="item.id" class="list-item" @click="handleClick(item)">
      <div class="title">{{ item.title }}</div>
      <div class="name">{{ item.name }}</div>
      <div class="time">{{ item.time }}</div>
    </div>
    <div class="more">更多>></div>
    <div class="list-header">更多内容</div>
    <div>
      <span>内容准备中，敬请期待</span>
    </div>
  </div>
</template>

<script>
import { list } from '@/config/data'
export default {
  name: 'home',
  components: {
  },
  data(){
    return {
      list
    }
  },
  methods: {
    handleClick(item) {
      this.$router.push({
        path: '/detail',
        query: {
          id: item.id
        }
      })
    }
  }
}
</script>

<style lang="less" scoped>
.logic-home {
  width: 50%;
}
.list-header {
  border-bottom: 1px solid #ebeef5;
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: bold;
  padding: 10px 0;
}
.list-item {
  margin-bottom: 20px;
  display: flex;
  cursor: pointer;
  user-select: none;
  padding: 5px 10px;
  margin-right: 20px;
  border-radius: 5px;
  color: #333;
  &:hover{
    background-color: #e5f2ff;
  }
  .title {
    flex-grow: 1;
  }
  .name {
    flex-shrink: 0;
    margin-right: 20px;
  }
  .time {
    flex-shrink: 0;
    font-size: 12px;
    color: #999;
  }
}
.more {
  text-align: right;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  color: #999;
}
</style>
